#include "sysconfig.h"
#include "Shaders.h"

using namespace System;
using namespace AmiEmuLib::Render::Filter::ShaderFilter;

namespace CLR
{
    namespace Shaders
    {
        void GetShadersNames(CArray<CString>* a_array)
        {
            a_array->RemoveAll();
            for each(String ^ name in AmiEmuLib::Render::Filter::ShaderFilter::Shaders::GetShadersNames())
            a_array->Add(CString(name));
        }

        CString GetShaderCode(const CString& name)
        {
            for each(Shader ^ shader in AmiEmuLib::Render::Filter::ShaderFilter::Shaders::List)
            {
                if (CString(shader->Name) == name)
                    return CString(shader->GetCode());
            }

            return "";
        }

        CString ShaderNameToFileName(CString a_shaderName)
        {
            for each(Shader ^ shader in AmiEmuLib::Render::Filter::ShaderFilter::Shaders::List)
            if (a_shaderName == CString(shader->Name))
                return CString(shader->FileName);
            return "";
        }

        CString FileNameToShaderName(CString a_fileName)
        {
            for each(Shader ^ shader in AmiEmuLib::Render::Filter::ShaderFilter::Shaders::List)
            if (a_fileName == CString(shader->FileName))
                return CString(shader->Name);
            return "";
        }
    }
}